package com.wj.tool.common.utils.paging;

import javax.validation.Valid;
import java.io.Serializable;
import java.util.Objects;

public class QueryParameters<P> implements Serializable {
    private static final long serialVersionUID = 3664372364345305813L;
    @Valid
    private Paging paging;
    @Valid
    private P parameters;

    public QueryParameters() {
    }

    public Paging getPaging() {
        return this.paging;
    }

    public void setPaging(Paging paging) {
        this.paging = paging;
    }

    public P getParameters() {
        return this.parameters;
    }

    public void setParameters(P parameters) {
        this.parameters = parameters;
    }

    public boolean equals(Object o) {
        if (this == o) {
            return true;
        } else if (o != null && this.getClass() == o.getClass()) {
            QueryParameters<?> that = (QueryParameters)o;
            return Objects.equals(this.paging, that.paging) && Objects.equals(this.parameters, that.parameters);
        } else {
            return false;
        }
    }

    public int hashCode() {
        return Objects.hash(new Object[]{this.paging, this.parameters});
    }

    public String toString() {
        return "QueryParameters{paging=" + this.paging + ", parameters=" + this.parameters + '}';
    }
}
